﻿using System;
using System.Collections.Generic;
using System.ComponentModel;

namespace testapp.ViewModels
{
    public class MainViewModel : INotifyPropertyChanged
    {
        private string _diameter;
        private string _weight;
       
        public MainViewModel()
        {
        }

        public string Diameter
        {
            get { return _diameter; }
            set 
            {
                if (value != null && value != _diameter)
                {
                    _diameter = value;
                    RaisePropertyChanged("Diameter");
                }
            }
        }

        public string Weight
        {
            get { return _weight; }
            set
            {
              if (value != null && value != _weight)
              {
                _weight = value;
                RaisePropertyChanged("Weight");
              }
            }
        }

        public string Thread { get; set; }
        public string Profile { get; set; }

        public event PropertyChangedEventHandler PropertyChanged;

        private void RaisePropertyChanged(string propName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propName));
        }
    }
}
